<template>
  <div class="mark" v-if="isOpenImg" @click="closeDoailg">
    <div class="pcimgBox" v-if="isWeb">
      <span class="iconfont close" @click="closeDoailg">&#xe66b;</span>
      <img :src="previewUrl" alt="" />
    </div>
    <div class="h5imgBox" v-else>
      <span class="iconfont close" @click="closeDoailg">&#xe66b;</span>
      <img :src="previewUrl" alt="" />
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      isOpenImg: false,
      previewUrl: "",
    };
  },
  props: {},
  computed: {
    isWeb() {
      return document.body.clientWidth >= 750;
    },
    isH5() {
      return 750 > document.body.clientWidth;
    },
  },
  methods: {
    clickOpen(url, isPreview) {
      if (isPreview) {
        this.isOpenImg = true;
        this.previewUrl = url;
      }
    },
    closeDoailg() {
      this.isOpenImg = false;
    },
  },
};
</script>